package com.example.dou2204.roomdb;

import static androidx.room.OnConflictStrategy.REPLACE;

import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

import com.example.dou2204.entity.MoneyEntity;
@Dao
public interface MoneyDao {
    @Insert(onConflict = REPLACE)
    void insertMoney(MoneyEntity entity);//当创建新用户时，创账号
    @Query("select * from account where name=:name")
    MoneyEntity queryMoney(String name);//展示用户余额时，查询指定账号
    @Update
    void updateMoney(MoneyEntity entity);//进行充值或者发完礼物时，进行余额的更新
}
